Videos are provided in this course if you prefer to watch instead of reading the text below. Note that some Quiz answers might require you to read the text.
After completing this lesson, you’ll be able to:
Whereas filter transformers divide data into different streams, other transformers combine data streams, merging the data according to user-defined conditions. Here (for example), incoming streams A and B are joined together with a FeatureJoiner into a new stream, C:
FME allows users to append or merge (or join) their data to combine multiple data streams. Although seemingly similar, the two techniques yield different results. When datasets are appended, additional rows (in FME, features) are added to the attribute table. However, additional columns (in FME, attributes) are added when datasets are merged or joined.
Append
Datasets are typically appended when the table schema or data model does not change. Appending can use the same schema since the values of one dataset are added after the existing values of another.
If the table schemas are different, the output will contain missing values for the columns not contained in both datasets.
Appends should be used when additional rows or records are added to the dataset. Appends are performed by combining multiple feature connection lines into a single input port on a transformer or writer feature type.
This example workspace appends records from both tables into a single table.
Joining or Merging
Datasets should be combined by merging when additional attributes must be added to the table schema or data model.
Merging requires a common attribute to join on, ensuring that the new attributes are correctly matched within the output. Missing values can exist within either dataset, provided the attribute being merged upon does not contain missing values.
Datasets can be merged using a variety of transformers, including the FeatureMerger (depicted below) and the DatabaseJoiner. To join datasets using their spatial location, use the SpatialFilter or SpatialRelator.
This example workspace merges the attributes from both tables into one table.
You must define a relationship for the basis of the join to merge data. In FME, you define the relationship using one of several transformers.
These transformers allow you to merge data, including joining against a database or other external dataset.
Joins in FME can either be based on matching attribute values (DatabaseJoiner or FeatureMerger/FeatureJoiner) or a spatial relationship, such as an overlap between features or proximity from one feature to another (NeighborFinder or SpatialRelator).
This course covers joining data based on shared attribute values. Check out this article to learn more about joining data based on spatial relationships.